Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-24244: Support timeout in RW transactions #5209

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

PakhomovAlexander
Copy link
Contributor

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

@PakhomovAlexander PakhomovAlexander changed the title WIP IGNITE-24244: Support timeout in RW transactions Feb 13, 2025
# Conflicts:
#	modules/client/src/test/java/org/apache/ignite/client/fakes/FakeTxManager.java
#	modules/table/src/integrationTest/java/org/apache/ignite/internal/table/ItColocationTest.java
#	modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java
#	modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
#	modules/table/src/test/java/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java
#	modules/transactions/src/integrationTest/java/org/apache/ignite/tx/distributed/ItTransactionRecoveryTest.java
#	modules/transactions/src/main/java/org/apache/ignite/internal/tx/TxManager.java
#	modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TransactionInflights.java
#	modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxCleanupRequestSender.java
#	modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxManagerImpl.java
#	modules/transactions/src/test/java/org/apache/ignite/internal/tx/impl/ReadWriteTransactionImplTest.java
*
* @return The future.
*/
default CompletableFuture<Void> rollbackTimeoutExceededAsync() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why do we need this method in addition to common rollbackAsync().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive removed the default implementation. I can't see another way to provide an information that the transactions was rolled back because of timeout exceeded.

return rollbackAsync();
}

default boolean isTimeoutExceeded() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify guaranties of the method in the contract. It's not clear whether the method will return true if logical timeout was exceeded or if it was detected, etc? In other words if transactions with timeout 20 was started at HLC timestamp t(10,10) will isTimeoutExceeded return true if HLC(t30, X)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added java doc and changed the naming. Does it make sense?

@@ -149,7 +149,9 @@ default InternalTransaction beginExplicitRo(HybridTimestampTracker timestampTrac
* @param ts The timestamp which is associated to txn completion.
* @param commit {@code True} if a commit requested.
*/
void finishFull(HybridTimestampTracker timestampTracker, UUID txId, @Nullable HybridTimestamp ts, boolean commit);
void finishFull(
HybridTimestampTracker timestampTracker, UUID txId, @Nullable HybridTimestamp ts, boolean commit, boolean timeoutExceeded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does timeoutExceeded=true matches with commit = true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added assertions and adjusted javadoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants